Jiaqi Chen (jc5681), Xinran Sun (xs2447), Yiru Gong (yg2832), Yunlin Zhou (yz4184)

Data Input

happy_df = readxl::read_xls('DataPanelWHR2021C2.xls') %>% 
  janitor::clean_names()

World map of Happiness

happy_iso3 = happy_df %>% 
  subset(
    country_name != "Kosovo" & country_name != "Somaliland region"
  ) %>% 
  mutate(
    country_code = countrycode(country_name, "country.name", "iso3c")
  ) %>% 
  relocate(country_code)
plot_2018_map = happy_iso3 %>% 
  filter(year == 2018) %>% 
  plot_ly(
    type = 'choropleth', locations = ~country_code, z = ~life_ladder,
    text = ~country_name
  )

plot_2018_map

Happiness score Rank

barplot

Yearly Trend

line plot

Regression Model